const validatePhone = (rule, value, callback) => {
    let patter = new RegExp("^1[0-9]{10}$");//简单验证11位手机号
    if (!patter.test(value)) {
        return callback(new Error("请输入正确格式的手机号！"));
    } else {
        callback();//必须有此项回调，否则验证会一直不通过
    }
};
export default {
    common:{
        //手机号校验
        resume:[{
            required: true,
            message: "手机号不能为空",
            trigger: 'blur'
        },{
            validator: validatePhone,
            trigger: "blur",
            message: "请输入正确的证件号"
        }],
        name:[
            {required: true,message: "姓名不能为空" }
        ]
    },
    carForm:{
        userId:[{required: true,message: "发布人必须检索，然后点击选择一个人" }],
        sellerName:[{required: true,message: "卖车人姓名不能为空" }],
        sellerMobile: [{required: true,message: "卖出人手机号不能为空" }],
        cityId:[{required: true,message: "城市不能为空" }],
        address:[{required: true,message: "地址不能为空" }],
        parentBrand:[{required: true,message: "车辆品牌不能为空" }],
        brandId:[{required: true,message: "车辆品牌不能为空" }],
        // buyDate:[{required: true,message: "上户日期不能为空" }],
        outStandard:[{required: true,message: "排放标准不能为空" }],
        enginePower:[{required: true,message: "最大马力不能为空" }],
        boxLength:[{required: true,message: "箱体长度不能为空" }],
        sellPrice:[{required: true,message: "车辆价格（单位：万元）不能为空" }],
        // driverType:[{required: true,message: "驱动类型不能为空" }],
        // engineId:[{required: true,message: "发动机品牌不能为空" }],
        // fuelType:[{required: true,message: "燃料类型不能为空" }],
        // mileage:[{required: true,message: "表显里程不能为空" }],
        // color:[{required: true,message: "车辆颜色不能为空" }],
        imgs:[{required: true,message: "车辆的图片不能为空" }],
        typeId:[{required: true,message: "车型不能为空" }],
        status:[{required: true,message: "审核结果不能为空" }]
    },
    bannerForm:{
        name:[{required: true,message: "轮播图名称不能为空！" }],
        sort: [{required: true,message: "排序不能为空" }],
        imgUrl:[{required: true,message: "图片必须上传" }]
    },
    userForm:{
        headImg:[{required: true,message: "用户头像不能为空！" }],
        mobile:[{required: true,message: "请输入正确的手机号！",validator: validatePhone }],
        nickName: [{required: true,message: "公司名称不能为空" }]
    },



}